package com.ophiux.common.core.utils;

import java.nio.charset.StandardCharsets;

import org.springframework.util.DigestUtils;

/**
 * @author FuJJ
 * @version 1.0.0
 * @date 2021/8/5 16:07
 */
public class MD5Utils {

    /**
     * 加盐秘钥
     */
    private final static String SALT = "ophiux_salt";

    /**
     * 密码加密
     *
     * @param password
     * @return 加密后的值
     */
    public static String md5Password(String password) {
        String tempPassword = password + SALT;
        return DigestUtils.md5DigestAsHex(tempPassword.getBytes(StandardCharsets.UTF_8));
    }

}
